Java Programming: Python Programming: Master Programming Guide: Learn In A Day Series (Python, Java, SQL, PHP, HTML, Ruby)

Java Programming: Python Programming: Master Programming Guide: Learn In A Day Series (Python, Java, SQL, PHP, HTML, Ruby)

Author:Swift, Os [Swift, Os]
Language: eng
Format: epub
Published: 2016-03-22T07:00:00+00:00


OUTPUT: "Python"

Another way to deal with printing single or double quotes is enclosing them within triple quotes:

print ''' "I am happy", said Michael. '''

OUTPUT: "I am happy", said Michael.

It is applicable only to strings that do not have triple quotes within the string as normal characters. If triple quotes are also present inside the string, backslash comes into play again. Look at the following example:

print ''' Triple quotes (''') are never used in written English'''

The above example gives an error, as the interpreter assumes that the triple quotes given within the bracket (''') indicate the end of the string. The problem can be solved using backslash again.

print ''' Triple quotes (\''') are never used in written English'''



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.